package com.itheima.cn;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class AnnoDemo1 {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class Clazz = Class.forName("com.itheima.cn.UseTest");
        Method[] declaredMethods = Clazz.getDeclaredMethods();
        UseTest o = (UseTest)Clazz.newInstance();
        for (Method declaredMethod : declaredMethods) {
            if(declaredMethod.isAnnotationPresent(Test.class)){
                declaredMethod.invoke(o);
            }
        }
    }
}
